import { Ref, ref } from "vue";

export function joyDisplayController() {
  const joyDisplay = ref(false);
  const fov = ref(75);

  const joyDisplayController = (joyDisplay: Ref, fov: Ref) => {
    if (window.innerWidth <= 992) {
      joyDisplay.value = true;
      fov.value = 100;
    } else {
      joyDisplay.value = false;
      fov.value = 75;
    }

    window.addEventListener("resize", (e) => {
      if (window.innerWidth <= 992) {
        joyDisplay.value = true;
        fov.value = 100;
      } else {
        joyDisplay.value = false;
        fov.value = 75;
      }
    });
  };

  return { joyDisplayController, joyDisplay, fov };
}
